x86/boot: Make alternative patching NMI-safe
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 31 Jan 2018 16:09:39 +0000 (16:09 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 7 Feb 2018 12:32:58 +0000 (12:32 +0000)
commit5191c1ef51b00ec112206917647faea55be8b02f
treede26041a17ca370a303caeea14d6f4200bede14f
parentcf4b30dca0ad73e87802df83c5297abee9960c22
x86/boot: Make alternative patching NMI-safe

During patching, there is a very slim risk that an NMI or MCE interrupt in the
middle of altering the code in the NMI/MCE paths, in which case bad things
will happen.

The NMI risk can be eliminated by running the patching loop in NMI context, at
which point the CPU will defer further NMIs until patching is complete.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/arch/x86/alternative.c